
const TokenKey = 'Admin-Token'

const ExpiresInKey = 'Admin-Expires-In'

const UserKey = 'Admin-User'

const InvitationKey = 'Invitation-Key'

const shareUrl = "share-url"

const ExchangeStatus = "Exchange-status"

const DonationStatus = "Donation-status"


export function getToken () {
  return uni.getStorageSync(TokenKey)
}

export function setToken (token) {
	return uni.setStorageSync(TokenKey,token)
}

export function removeToken () {
  return uni.removeStorageSync(TokenKey)
}

export function getData () {
  return uni.getStorageSync(UserKey) ? JSON.parse(uni.getStorageSync(UserKey)) : uni.getStorageSync(UserKey)
}

export function setData (data) {
	return uni.setStorageSync(UserKey, JSON.stringify(data))
}

export function removeData () {
  return uni.removeStorageSync(UserKey)
}

export function setIsMobileCookie (val) {
  return uni.setStorageSync(IsMobileCookie, val)
}

export function getIsMobileCookie (val) {

  return uni.getStorageSync("IsMobileCookie")
}

export function getExpiresIn() {
  return uni.getStorageSync(ExpiresInKey) || -1
}

export function setExpiresIn(time) {
  return uni.setStorageSync(ExpiresInKey, time)
}

export function removeExpiresIn() {
  return uni.removeStorageSync(ExpiresInKey)
}


//邀请人id


export function setInvitationId (data) {
	return uni.setStorageSync(InvitationKey,data)
}

export function getInvitationId () {
  return uni.getStorageSync(InvitationKey)
}

export function removeInvitationId() {
  return uni.removeStorageSync(InvitationKey)
}


//地址
export function setShareUrl (data) {
	return uni.setStorageSync(shareUrl,data)
}

export function getShareUrl () {
  return uni.getStorageSync(shareUrl)
}

export function removeShareUrl() {
  return uni.removeStorageSync(shareUrl)
}

//实物兑换
export function setExchangeStatus (data) {
	return uni.setStorageSync(ExchangeStatus,data)
}

export function getExchangeStatus () {
  return uni.getStorageSync(ExchangeStatus)
}
//转增
export function setDonationStatus(data) {
	return uni.setStorageSync(DonationStatus,data)
}

export function getDonationStatus () {
  return uni.getStorageSync(DonationStatus)
}